\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{htwsek}[2012/05/05 v. 0.1 Einstellungen]

%-- Packages
\RequirePackage[utf8]{inputenc}     %zeichenkodierung
\RequirePackage[T1]{fontenc}        %Computer-Modern-Schriftfamilie
\RequirePackage[ngerman]{babel}     %deutsche sprache
\RequirePackage{mathptmx}           %mathematikschriften 
\RequirePackage{textcomp}           %symbole
\RequirePackage{courier}
\RequirePackage{fancyhdr}           %seiten layout
\RequirePackage[pdftex]{graphicx}   %bilder
\RequirePackage{scrhack}
\RequirePackage{listings}           %source code printer
\RequirePackage{setspace}           %zeilenabstand
\RequirePackage{pdfpages}           %einbinden von pdf seiten
\RequirePackage[printonlyused]{acronym} %abkürzungsverzeichnis
\RequirePackage{makeidx}            %index
\RequirePackage{tabularx}           %tabellen
\RequirePackage{float}              %positionierung
\RequirePackage{paralist}           %aufzaehlungen
\RequirePackage[pdftex]{hyperref}
\RequirePackage{color}
\RequirePackage{colortbl}
%\RequirePackage[svgnames]{xcolor}
\RequirePackage[intoc]{nomencl}
\RequirePackage[numbers,sort&compress]{natbib}
\RequirePackage{dirtree}    %package zur Darstellung von Verzeichnisbäumen
\RequirePackage{xargs}
\RequirePackage{ifthen}

%-- Variables definition
\newboolean{printBibliography}
\newboolean{BibliographyOnNewpage}
\newboolean{printListoflistings}
\newboolean{ListoflistingsOnNewpage}
\newboolean{printListoffigures}
\newboolean{ListoffiguresOnNewpage}
\newboolean{printListoftables}
\newboolean{ListoftablesOnNewpage}
\newboolean{printNomenclature}
\newboolean{NomenclatureOnNewpage}
\newboolean{printAcronyms}
\newboolean{AcronymsOnNewpage}
\newboolean{printIndex}
\newboolean{printAppendix}
\newboolean{printHistory}

%-- Page layout
\pagestyle{fancy}       
\fancyhf{}

%-- Header settings
\fancyhead[L]{\small\sffamily\nouppercase{\leftmark}}
\fancyhead[R]{\small\sffamily \doctitle}

%-- Footer settings
\fancyfoot[R]{\small\sffamily Seite \thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\fancypagestyle{plain}{}

%-- Table settings
\RequirePackage{array}              %stellt den Befehl \newcolumntype bereit
\RequirePackage{longtable}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash\hspace{0pt}}p{#1}}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash\hspace{0pt}}p{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash\hspace{0pt}}p{#1}}

%-- Predefined colors
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\definecolor{listingcolor}{gray}{0.85}

%-- Global Listing settings
\lstset{%
    numberstyle=\tiny,
    breaklines=true,
    breakautoindent=true,
    backgroundcolor=\color{listingcolor},
    frame=tlrb
    keywordstyle=\color{blue},
    commentstyle=\color{dkgreen},, 
    stringstyle=\color{mauve},
    moredelim=[is][\bfseries]{[*}{*]},
    basicstyle=\ttfamily\scriptsize,    % the size of the fonts that are used for the code
    showspaces=false,               % show spaces adding particular underscores 
    showstringspaces=false,         % underline spaces within strings
    showtabs=false,                 % show tabs within strings adding particular underscores
    tabsize=4,                      % sets default tabsize to 2 spaces
    captionpos=b,                   % sets the caption-position to bottom     
    numbers=left,                   % show line numbers                  
    numbersep=10pt,                 % space between line numbers and source
    xleftmargin=50pt,
    xrightmargin=50pt,
    literate={Ö}{{\"O}}1 {Ä}{{\"A}}1 {Ü}{{\"U}}1 {ß}{{\ss}}2 {ü}{{\"u}}1
    {ä}{{\"a}}1 {ö}{{\"o}}1     
}

\lstdefinelanguage{TTCN-3}{morekeywords={
                TODO, module, modulepar,
                testcase, charstring, integer,
                template, type, port,
                message, inout, all,
                component, timer, runs,
                on, system, TODO
                }, 
                morekeywords=[2]{
                BAR, map, mtc,
                system, send, start,
                alt, receive, stop,
                setverdict, pass, fail,
                timeout, unmap, FOO
                }
                sensitive=true,
                morecomment=[l]{//},
                morecomment=[s]{/*}{*/},
                morestring=[b]",
            }

%-- Own environments
\newenvironment {history}
            {
                \begin{longtable} {|p{2cm}|p{4cm}|p{8cm}|}
                    \hline 
                    Datum & Autor & Änderung\\ 
                    \hline
                } 
                {
                \end{longtable} 
                \addtocounter{table}{-1}
            }

%-- Own commands
\newcommand{\lecturetitle}{lecturetitle NOT SET!}
\newcommand{\doctitle}{}
\newcommand{\docauthor}{docauthor NOT SET!}
\newcommand{\pdfauthor}{pdfauthor NOT SET!}
\newcommand{\zB}{z.\,B. }
\newcommand{\heading}[1]{\textbf{#1}\par\bigskip}
\newcommand{\historyline}[3]{#1 & #2 & #3\\ \hline}
\newcommandx\supersection[9][2=, 3=, 4=, 5=, 6=, 7=, 8=, 9=]{
            \newpage
            \markboth{}{}% maybe with \MakeUppercase
            \vspace*{1cm}
            \part{#1}
            \vspace{1cm}
            Autoren:\par\bigskip 
            \hspace{1cm}#2\par
            \hspace{1cm}#3\par
            \hspace{1cm}#4\par
            \hspace{1cm}#5\par
            \hspace{1cm}#6\par
            \hspace{1cm}#7\par
            \hspace{1cm}#8\par
            \hspace{1cm}#9\par
        }

%-- Additional text options
\hypersetup{
        bookmarksopen=true,
        bookmarksnumbered=true,
        pdfborder={000},
        pdffitwindow=true,      % window fit to page when opened
        colorlinks=false,       % false: boxed links; true: colored links
        linkcolor=red,          % color of internal links
        citecolor=green,        % color of links to bibliography
        filecolor=magenta,      % color of file links
        urlcolor=cyan           % color of external links
    }
\hypersetup{pdfborder={000}}

\clubpenalty = 10000            % Keine "Schusterjungen"
\widowpenalty = 10000 \displaywidowpenalty = 10000  % Keine "Hurenkinder"

\parindent0pt   %automatischer Einschub nach Absätzen ausschalten

\makenomenclature
\makeindex

\renewcommand*\familydefault{\sfdefault}
\setlength{\headheight}{30pt}

\makeatletter
\setkomafont{partnumber}{\usekomafont{part}\@hangfrom}
\makeatother
\renewcommand*{\partformat}{\thepart\autodot\enskip}
\renewcommand*{\partheadmidvskip}{}
\renewcommand{\nomname}{Glossar}
